package cn.zhage.aimin.auth1.entity;

import cn.zhage.aimin.ds1.annotation.DictTranslate;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.yulichang.annotation.EntityMapping;
import lombok.Data;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/*
 *
 * @author 渣哥
 */
@Data
@TableName("t_user1")
public class User {

    private Integer id;

    @TableField("username")
    private String username;

    @TableField("password")
    private String password;

    @TableField(exist = false)
    @EntityMapping(thisField = "pid", joinField = "id")
    private User parent;

    @TableField("pid")
    private int pid;

    @TableField("sex")
    //@DictTranslate(valueTo = "sexName")
    private int sex;

    @TableField(exist = false)
    private String sexName;

    @TableField(exist = false)
    @EntityMapping(thisField = "id", joinField = "userId")
    private List<Address> addressList;

    @TableLogic
    private int deleted;

    private LocalDate createTime;
}
